﻿using System;
using HslCommunication.BasicFramework;

namespace HslCommunication.MQTT
{
	/// <summary>
	/// 订阅的消息类，用于客户端向服务器请求订阅的信息<br />
	/// Subscribed message class, used by the client to request subscription information from the server
	/// </summary>
	// Token: 0x020000C8 RID: 200
	public class MqttSubscribeMessage
	{
		/// <summary>
		/// 实例化一个默认的对象<br />
		/// Instantiate a default object
		/// </summary>
		// Token: 0x06000ED6 RID: 3798 RVA: 0x00057848 File Offset: 0x00055A48
		public MqttSubscribeMessage()
		{
			this.QualityOfServiceLevel = MqttQualityOfServiceLevel.AtMostOnce;
		}

		/// <summary>
		/// 这个字段表示应用消息分发的服务质量等级保证。分为，最多一次，最少一次，正好一次<br />
		/// This field indicates the quality of service guarantee for application message distribution. Divided into, at most once, at least once, exactly once
		/// </summary>
		/// <remarks>
		/// 在实际的开发中的情况下，最多一次是最省性能的，正好一次是最消耗性能的，如果应有场景为推送实时的数据，那么，最多一次的性能是最高的
		/// </remarks>
		// Token: 0x1700022F RID: 559
		// (get) Token: 0x06000ED7 RID: 3799 RVA: 0x0005785A File Offset: 0x00055A5A
		// (set) Token: 0x06000ED8 RID: 3800 RVA: 0x00057862 File Offset: 0x00055A62
		public MqttQualityOfServiceLevel QualityOfServiceLevel { get; set; }

		/// <summary>
		/// 当前的消息的标识符，当质量等级为0的时候，不需要重发以及考虑标识情况<br />
		/// The identifier of the current message, when the quality level is 0, do not need to retransmit and consider the identification situation
		/// </summary>
		// Token: 0x17000230 RID: 560
		// (get) Token: 0x06000ED9 RID: 3801 RVA: 0x0005786B File Offset: 0x00055A6B
		// (set) Token: 0x06000EDA RID: 3802 RVA: 0x00057873 File Offset: 0x00055A73
		public int Identifier { get; set; }

		/// <summary>
		/// 当前订阅的所有的主题的数组信息<br />
		/// Array information of all topics currently subscribed
		/// </summary>
		// Token: 0x17000231 RID: 561
		// (get) Token: 0x06000EDB RID: 3803 RVA: 0x0005787C File Offset: 0x00055A7C
		// (set) Token: 0x06000EDC RID: 3804 RVA: 0x00057884 File Offset: 0x00055A84
		public string[] Topics { get; set; }

		/// <inheritdoc />
		// Token: 0x06000EDD RID: 3805 RVA: 0x0005788D File Offset: 0x00055A8D
		public override string ToString()
		{
			return "MqttSubcribeMessage" + SoftBasic.ArrayFormat<string>(this.Topics);
		}
	}
}
